import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/job/findJobList',
    method: 'get',
    params
  })
}

export function triggerJob(params) {
  return request({
    url: '/job/trigger',
    method: 'post',
    data: params
  })
}

export function runOrStopJob(params) {
  return request({
    url: '/job/runOrStopJob',
    method: 'post',
    data: params
  })
}

export function editJob(params) {
  return request({
    url: '/job/editJob',
    method: 'post',
    data: params
  })
}

export function addJob(params) {
  return request({
    url: '/job/addJob',
    method: 'post',
    data: params
  })
}

export function removeJob(params) {
  return request({
    url: '/job/removeJob',
    method: 'post',
    data: params
  })
}

// 校验用户名重复
export function validateJobNameRepeat(params) {
  return request({
    url: '/job/validateJobNameRepeat',
    method: 'get',
    params
  })
}

